package com.xyb.service;

import com.xyb.dao.WebUserDao;
import com.xyb.entity.WebUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class WebUserService {
    @Resource
    private WebUserDao webUserDao;

    /**
     * 查询该手机号是否注册过
     *
     * @param iphoneNo
     * @return true 表示注册过,
     */
    public boolean selectIphoneIsRegistered(String iphoneNo) {
        WebUser webUser = webUserDao.selectWebUserByIphoneNo(iphoneNo);
        if (webUser != null) {
            return true;
        }
        return false;
    }

    public boolean selectEmailIsRegistered(String email) {
        WebUser webUser = webUserDao.selectWebUserByEmail(email);
        if (webUser != null) {
            return true;
        }
        return false;
    }
}
